<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
	<title>老司机修车网后台登录</title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Cache-Control" content="no-siteapp" />

    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="./css/font.css">
	<link rel="stylesheet" href="./css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script src="./lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>

</head>
<body class="login-bg">

    <div class="login layui-anim layui-anim-up">
        <div class="message">老司机修车网</div>
        <div id="darkbannerwrap"></div>
        <form method="post" class="layui-form" >
            <input name="adminAccount" placeholder="用户名"  type="text" lay-verify="required"/>
            <hr class="hr15">
            <input name="adminPwd" placeholder="密码"  type="password" lay-verify="required"/>
            <hr class="hr15">
            <input value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit"/>
            <hr class="hr20" >
        </form>
    </div>

    <script src="lib/layui/layui.js"></script>
    <script type="text/javascript">
        layui.use(['form', 'jquery'], function () {
            var form = layui.form;
            var $ = layui.jquery;


            form.on('submit(login)', function (data) {
                var name = $('input[name=adminAccount]').val();
                var pwd = $('input[name=adminPwd]').val();
                layer.msg("登陆中...", {icon: 6, time: 1000, anim: 4},

                    /*
                     *layui传递Ajax
                     * */
                    $.post("http://admin.516code.cn/backstage/LoginAdmin.do",{"adminAccount":name,"adminPwd":pwd},function(res){
                           if (res.data.adminAccount == name && res.data.adminPwd == pwd) {
                               window.location.href = 'index.html';
                           } else {
                             layer.msg("用户名或密码错误",{icon:5,time:1000,anim:4});
                           }
                    }));
                return false;
            });



        });
    </script>

    
    <!-- 底部结束 -->

</body>
</html>